var http = require('http'),
  url = require('url'),
  querystring = require('querystring'),
  util = require('util');

http.createServer(function(req, res) {
  var pathname = url.parse(req.url).pathname, // 'hello'
    paramStr = url.parse(req.url).query, // 'c=doAction'
    param = querystring.parse(paramStr); // {c:'doAction'}
  console.log('pathname:' + pathname);
  console.log('paramStr:' + paramStr ? paramStr : 'no params');
  console.log('param:'+util.inspect(param));
  if (pathname === '/favicon.ico') {
    return;
  }
  res.writeHead(200,{'Content-Type':'text/plain'});
  res.end('success');
}).listen(3000);
console.log('server start at http://127.0.0.1:3000');
